package basic._02_单例模式;

/**
 * @author： YHSimon
 * @date： 2022-07-08 15:15
 */
// 双重校验锁
public class Singleton4 {
    private static volatile Singleton4 instance;
    private Singleton4(){}
    public static Singleton4 getInstance(){
        if(instance==null){
            synchronized (Singleton4.class){
                instance=new Singleton4();
            }
        }
        return instance;
    }

}
